class AddUsers < ActiveRecord::Migration
  def self.up

    u = User.new(  :login => "admin",
                 :email => "wae.web08@gmail.com",
                 :password => "admin9",
                 :password_confirmation => "admin9",
                 :name => "WAE Admin",
                 :gender => "M",
                 :state => "active",
                 :exclude => "F")
    u.save

    u = User.new(  :login => "ravi",
                 :email => "mondi.ravi@ait.ac.th",
                 :password => "ravi99",
                 :password_confirmation => "ravi99",
                 :name => "Ravi",
                 :gender => "M",
                 :state => "active",
                 :exclude => "F")
    u.save

    u = User.new(  :login => "editor",
                 :email => "mondi.ravi@cs.ait.ac.th",
                 :password => "editor",
                 :password_confirmation => "editor",
                 :name => "Ravi Editor",
                 :gender => "M",
                 :state => "active",
                 :exclude => "F")
    u.save

    u = User.new(     :login => "eat",
                    :email => "st111002@ait.ac.th",
                    :password => "eat999",
                    :password_confirmation => "eat999",
                    :name => "Eat",                    
                    :gender => "F",
                    :state => "active",
                    :exclude => "F")
    u.save

    if true
      u = User.find_by_login "admin"
      u.roles.push(Role.find_by_name "admin")
      u.save

      u = User.find_by_login "ravi"
      u.roles.push(Role.find_by_name "agency")
      u.save

      u = User.find_by_login "eat"
      u.roles.push(Role.find_by_name "tourist")
      u.save

      u = User.find_by_login "editor"
      u.roles.push(Role.find_by_name "editor")
      u.save
    end

  end

  def self.down
  end
end